<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <button @click="sendToMain()">sendToMain</button>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String,
  },
  mounted() {
    window.api.receive('fromMain', (args) => {
      this.msg = args;
    });
  },
  methods: {
    sendToMain() {
      window.api.send('toMain', 'Hello');
    },
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss"></style>
